// Copyright 2013 Google Inc. All Rights Reserved.
//
// Define atexit using __cxa_atexit.
//

#include <stdlib.h>

extern void *__dso_handle __attribute__((weak));
extern int __cxa_atexit(void (*)(void*), void*, void*);

int atexit(void (*function)(void)) {
  return __cxa_atexit((void (*)(void *))function, NULL  /* arg */,
                      __dso_handle);
}
